<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>

<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" href="catalog/view/theme/default/stylesheet/AnNing.css" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php echo $google_analytics; ?>
</head>
<script type="text/javascript" src="catalog/view/javascript/jquery/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/colorbox/colorbox.css" media="screen" />

<?php if(!isset($route)||in_array($route,array('common/home',''))){ ?>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/nivo-slider/default/default.css" media="screen" />

<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/slideshow.css" media="screen" />
<script type="text/javascript" src="catalog/view/javascript/jquery/nivo-slider/jquery.nivo.slider.pack.js"></script>
<?php } ?>
<script type="text/javascript">
/* Ajax Cart */
	$('#cart > .heading a').live('mouseon', function() {
		$('#cart').addClass('active');
		
		$('#cart').load('index.php?route=module/cart #cart > *');
		
		$('#cart').live('mouseleave', function() {
			$(this).removeClass('active');
		});
	});
<?php if(!isset($route)||in_array($route,array('common/home','product/manufacturer/product','product/special/oth','','product/category','product/search'))){ ?>
	function init(){
		var left_h = $(".leftBar").height();
		$(".page").css("min-height",left_h);
		
		$("._panel>div").hover(
			function(){
				$(this).css({background:"url(catalog/view/theme/default/images/products_hover.png) repeat-x",border:"1px solid #83b3ca"});
			},
			function(){
				$(this).css({background:"none",border:"1px solid #ffffff"});
			}
		);
	}
	function previous(id){
		if($("#"+id).find(":animated").size() > 0)return;
		var index = $("#"+id).find("div").index($("#"+id).find("div:visible:first"));
		if(index == 0){
			return;
		}else{
			index--;
			$("#"+id).find("div:eq("+index+")").show(300);
			$("#"+id).find("div:visible:last").hide(300);
		}
	}
	function next(id){
		if($("#"+id).find(":animated").size() > 0)return;
		var index = $("#"+id).find("div").index($("#"+id).find("div:visible:last"));
		if(index == $("#"+id).find("div").size()-1){
			return;
		}else{
			index++;
			$("#"+id).find("div:eq("+index+")").show(300);
			$("#"+id).find("div:visible:first").hide(300);
		}
	}
	$(function(){
		init();
		$("#pictures>div:gt(4)").hide();
	})
<?php }elseif(in_array($route,array('product/product','checkout/cart'))){ ?>


var buy = {},proColor = {};
buy.minus = function(doc_id,res_id){
	if($(res_id).val() == 1){
		$(doc_id).html(1);
		$(res_id).val(1);
		return;
	}else{
		$(res_id).val(parseInt($(res_id).val())-1);
		$(doc_id).html(parseInt($(res_id).val()));
	}
}
buy.plus = function(doc_id,res_id){
	$(res_id).val(parseInt($(res_id).val())+1);
	$(doc_id).html(parseInt($(res_id).val()));
}
proColor.minus = function(){
	var colors = ['red','blue','green','white','gray'];
	for(var c=0;c<colors.length;c++){
		if(colors[c] == $(".proColor").html()){
			break;
		}
	}
	if(c == 0){
		c = colors.length;
	}
	c--;
	$(".proColor").html(colors[c]);
}
proColor.plus = function(){
	var colors = ['red','blue','green','white','gray'];
	for(var c=0;c<colors.length;c++){
		if(colors[c] == $(".proColor").html()){
			break;
		}
	}
	if(c == colors.length - 1){
		c = -1;
	}
	c++;
	$(".proColor").html(colors[c]);
}

function tab(id){
	$("#"+id+">ul>li").click(function(){
		var index = $("#"+id+">ul>li").index($(this));
		tabClick(index);
	});
	function tabClick(index){
		$("#"+id+">ul>li").css({background:"none",border:"none"});
		$("#"+id+">ul>li:eq("+index+")").css({background:"url(catalog/view/theme/default/images/tab_03.png) repeat-x",borderRight:"1px solid #cbd9e2",borderLeft:"1px solid #cbd9e2"});
		$("#"+id+">dl>dd").hide();
		$("#"+id+">dl>dd:eq("+index+")").show();
	}
	tabClick(0);
}
function previous(id){
	if($("#"+id).find(":animated").size() > 0)return;
	var index = $("#"+id).find("img").index($("#"+id).find("img:visible:first"));
	if(index == 0){
		return;
	}else{
		index--;
		$("#"+id).find("img:eq("+index+")").show(300);
		$("#"+id).find("img:visible:last").hide(300);
	}
}
function next(id){
	if($("#"+id).find(":animated").size() > 0)return;
	var index = $("#"+id).find("img").index($("#"+id).find("img:visible:last"));
	if(index == $("#"+id).find("img").size()-1){
		return;
	}else{
		index++;
		$("#"+id).find("img:eq("+index+")").show(300);
		$("#"+id).find("img:visible:first").hide(300);
	}
}
function starLevel(id){
	var value = $("#"+id).html()*2;
	var star = parseInt($("#"+id).html());
	var starHalf = $("#"+id).html()*2%2;
	var starEmpty = 5 - star - starHalf;
	
	var html = "";
	if(star > 0){
		for(i=0;i<star;i++){
			html += "<img src='catalog/view/theme/default/images/icon_08.png'/>";
		}

	}
	
	if(starHalf == 1){
		html += "<img src='catalog/view/theme/default/images/icon_10.png'/>";
	}
	
	if(starEmpty > 0){
		for(j=0;j<starEmpty;j++){
			html += "<img src='catalog/view/theme/default/images/icon_11.png'/>";
		}

	}
	$("#"+id).html(html);
}

$(function(){
	init();
	tab("tab_01");
	tab("tab_02");
	
	starLevel("starLevel");
	
	$("#smallPics>img:gt(2)").hide();
	
	$("#smallPics>img").click(function(){
		var path = $(this).attr("src");
		var pic=$(this).attr("title");
		$("#image").attr('src',pic);
		$("#jqzoom").css("width","240px");
		$("#jqzoom").css("height","240px");
		$("#jqzoom").attr('href',pic);
		$("#bigPic").css({background:"url("+path+") center no-repeat"});
	});
});

function init(){
	var left_h = $(".left").height();
	$(".page").css("min-height",left_h-65);
	
	$("#products>div").hover(
		function(){
			$(this).css({background:"url(catalog/view/theme/default/images/products_hover.png) repeat-x",border:"1px solid #83b3ca"});
		},
		function(){
			$(this).css({background:"none",border:"1px solid #fff"});
		}
	);
	$(".products > div").hover(
		function(){
			$(this).css({background:"url(catalog/view/theme/default/images/products_hover.png) repeat-x",border:"1px solid #83b3ca"});
		},
		function(){
			$(this).css({background:"none",border:"1px solid #fff"});
		}
	);
	$("._panel > div").hover(
		function(){
			$(this).css({background:"url(catalog/view/theme/default/images/products_hover.png) repeat-x",border:"1px solid #83b3ca"});
		},
		function(){
			$(this).css({background:"none",border:"1px solid #fff"});
		}
	);
}
<?php }else{ ?>
$(function(){
	$(".ManageMain ul li").click(function(){
		var index = $(".ManageMain ul li").index($(this));
		tab(index);
	});
	function tab(index){
		$(".ManageMain ul li").css({background:"url(images/tab_01.png)",color:"#000"});
		$(".ManageMain ul li:eq("+index+")").css({background:"#1f8ed5",color:"#fff"});
		$(".ManageMain .list").show();
		$(".ManageMain .list:eq("+index+")").show();
		$(".ManageMain .list2").show();
		$(".ManageMain .list2:eq("+index+")").show();
	}
	tab(0);
});

<?php } ?>
$(document).ready(function() {
	$('#search input[name=\'filter_name\']').bind('keydown', function(e) {
			if (e.keyCode == 13) {
				url = $('base').attr('href') + 'index.php?route=product/search&filter_sub_category=true&filter_description=true';
				 
				var filter_name = $('input[name=\'filter_name\']').attr('value');
				
				if (filter_name) {
					url += '&filter_name=' + encodeURIComponent(filter_name);
				}
				
				location = url;
			}
		});
});
</script>
<body>
<div class="container">
	<div class="logo"></div>
	<div class="about">
		<a href="<?php echo $home; ?>"><?php echo $text_home; ?></a>
		&nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a>
		&nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="<?php echo $account; ?>"><?php echo $text_account; ?></a>
		&nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="http://blog.mallplus.ca" target="_blank">Blog</a>
		&nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="/index.php?route=product/special/oth&type=is_sale">On Sale</a>
	    </div>
    <div style="position:absolute;top:0px;right:0px;min-width:100px;z-index: 99;">
		<?php echo $cart ;?>
	</div>
	<?php if(false===strstr($route,"sitemap")&&false===strstr($route,"contact")&&false===strstr($route,"account")&&false===strstr($route,"checkout")&&false===strstr($route,"friend")) {?>
		<div class="search" id="search">
			<!-- <div>
				<?php foreach($search_key as $key){?>
					<a href="<?php echo $this->url->link('product/search&filter_sub_category=true&filter_description=true', 'filter_name=' . $key, 'SSL');?>"><?php echo $key;?></a>
				<?php }?>
			</div> -->
	        <div>
	            Free shipping on all orders over $45
	        </div>

			<table cellpadding="0" cellspacing="0" width="450">
			  <tr>
			    <td><img src="catalog/view/theme/default/images/inputSearch_left.png" /></td>
			    <td width="100%" style="background:url(catalog/view/theme/default/images/inputSearch_middle.png) repeat-x;">
				<input style="width:100%;border:none;background:none;color:#3b6c97;" type="text" name="filter_name" />
			    </td>
			    <td><img src="catalog/view/theme/default/images/inputSearch_right.png" /></td>
			    <td><img src="catalog/view/theme/default/images/icon_04.png" class="button-search" /></td>
			  </tr>
			</table>
		</div>
		<div class="login">
			<?php if($logged){ ?>
			    <?php echo $text_logged; ?>
			<?php }else{ ?>
				<?php echo $text_welcome; ?>
			<?php } ?>
		</div>
	<?php }?>	
